package com.ymatou.iapi.fundstrategy.parameter;

import java.util.List;

import com.ymttest.database.model.YmtFundDimension;
import com.ymttest.database.sqlwapper.YmtFundDimensionWapper;

public class YmtFundDimensiongetDimensionid {
	
	public static String[] ymtFundDimensiongetDimensionid() throws Exception {
	    try {
	    	
			//SQL Ymt_FundDimension ymtfp库			
	    	YmtFundDimensionWapper ymtFundDimensionWapper = new YmtFundDimensionWapper();
	    	//按照商品类目查询获取DimensionId
			List<YmtFundDimension> ymtFundDimensionlist1 = ymtFundDimensionWapper.selectdimension("商品类目");			
			YmtFundDimension ymtFundDimension1 = ymtFundDimensionlist1.get(0);    
	    	String fundDimension1 =ymtFundDimension1.getDimensionId();
	    		    	
	        //按照商品价格查询获取DimensionId
	        List<YmtFundDimension> ymtFundDimensionlist2 = ymtFundDimensionWapper.selectdimension("商品价格");
	        YmtFundDimension ymtFundDimension2 = ymtFundDimensionlist2.get(0);
	        String fundDimension2 =ymtFundDimension2.getDimensionId();
			
	        //按照用户查询获取DimensionId
	        List<YmtFundDimension> ymtFundDimensionlist3 = ymtFundDimensionWapper.selectdimension("国家");
	        YmtFundDimension ymtFundDimension3 = ymtFundDimensionlist3.get(0);
	        String fundDimension3 =ymtFundDimension3.getDimensionId();
	        
	        //按照新老买手查询获取DimensionId
	        List<YmtFundDimension> ymtFundDimensionlist4 = ymtFundDimensionWapper.selectdimension("新老买手");
	        YmtFundDimension ymtFundDimension4 = ymtFundDimensionlist4.get(0);
	        String fundDimension4 =ymtFundDimension4.getDimensionId();
	        
	        //按照新老客查询获取DimensionId
	        List<YmtFundDimension> ymtFundDimensionlist5 = ymtFundDimensionWapper.selectdimension("新老客");
	        YmtFundDimension ymtFundDimension5 = ymtFundDimensionlist5.get(0);
	        String fundDimension5 =ymtFundDimension5.getDimensionId();
	        
	        String[] aa = {fundDimension1,fundDimension2,fundDimension3,fundDimension4,fundDimension5};
	        	        
	        return aa;

	    	
		    }catch (Exception e) {  
		        e.printStackTrace();
		    }
	    
			return null;  

		}

}
